<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>管理员账户管理</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.7 -->
    <link rel="stylesheet" href="../../bower_components/bootstrap/dist/css/bootstrap.min.css"
          th:href="@{/LoginStyle/css/bootstrap.min.css}">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="../../bower_components/font-awesome/css/font-awesome.min.css"
          th:href="@{/LoginStyle/css/font-awesome.min.css}">
    <!-- Ionicons -->
    <link rel="stylesheet" href="../../bower_components/Ionicons/css/ionicons.min.css"
          th:href="@{/LoginStyle/css/ionicons.min.css}">
    <!-- DataTables -->
    <link rel="stylesheet" href="../../bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css"
          th:href="@{/AdminStyle/css/dataTables.bootstrap.min.css}">
    <!-- Theme style -->
    <link rel="stylesheet" href="../../dist/css/AdminLTE.min.css" th:href="@{/AdminStyle/css/AdminLTE.min.css}">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="../../dist/css/skins/_all-skins.min.css"
          th:href="@{/AdminStyle/css/skin-blue.min.css}">

    <link rel="stylesheet" th:href="@{/AdminStyle/css/example.css}">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- Google Font -->
    <link rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

    <header th:replace="~{/admin/fragment/example :: header}"/>
    <!-- Left side column. contains the logo and sidebar -->
    <aside th:replace="~{/admin/fragment/example :: aside}"/>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h3>
                管理员账户详情
                <small>账户列表</small>
            </h3>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
                <li><a href="#">账户管理</a></li>
                <li class="active">管理员账户管理</li>
            </ol>
        </section>
        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <!-- /.box-header -->
                        <div class="box-body">
                            <table id="example2" class="table table-bordered ">
                                <thead>
                                <tr>
                                    <th>管理员账户名</th>
                                    <th>权限等级</th>
                                    <th>可改变权限</th>
                                    <th>可更改用户密码</th>
                                    <th>可管理管理员账户</th>
                                    <th>可管理订单</th>
                                    <th>查看信息</th>
                                    <th>备注</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr th:each="admin:${adminList}">
                                    <td th:text="${admin.adminName}">test</td>
                                    <td th:text="${admin.power}">1</td>
                                    <td th:text="${session.power}==高级管理员?是:否">是</td>
                                    <td th:text="${session.power}==高级管理员?是:否">是</td>
                                    <td th:text="${session.power}==高级管理员?是:否">是</td>
                                    <td th:text="${session.power}==高级管理员?是:否">是</td>
                                    <td>是</td>
                                    <td th:text="${admin.remake}">无</td>
                                </tr>
                                </tfoot>
                            </table>
                        </div>
                        <!-- /.box-body -->
                    </div>
                    <!-- /.box -->
                </div>
                <!-- /.col -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="box-body">
                    <label for="name">账户名：</label>
                    <input id="name" type="text">
                    <label for="change">修改条目：</label>
                    <select id="change">
                        <option value="power" selected>权限</option>
                        <option value="email">邮箱</option>
                        <option value="phone">电话号码</option>
                    </select>
                    <label for="val">修改为：</label>
                    <input id="val" type="text">
                </div>
                <div class="box-body"><input id="submit" type="submit"></div>
            </div>
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
    <footer th:replace="~{/admin/fragment/example :: footer}"/>
</div>
<!-- ./wrapper -->

<!-- jQuery 3 -->
<script src="../../bower_components/jquery/dist/jquery.min.js" th:src="@{/LoginStyle/js/jquery.min.js}"></script>
<!-- Bootstrap 3.3.7 -->
<script src="../../bower_components/bootstrap/dist/js/bootstrap.min.js"
        th:src="@{/LoginStyle/js/bootstrap.min.js}"></script>
<!-- DataTables -->
<script src="../../bower_components/datatables.net/js/jquery.dataTables.min.js"
        th:src="@{/AdminStyle/js/jquery.dataTables.min.js}"></script>
<script src="../../bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"
        th:src="@{/AdminStyle/js/dataTables.bootstrap.min.js}"></script>
<!-- SlimScroll -->
<script src="../../bower_components/jquery-slimscroll/jquery.slimscroll.min.js"
        th:src="@{/AdminStyle/js/jquery.slimscroll.js}"></script>
<!-- FastClick -->
<script src="../../bower_components/fastclick/lib/fastclick.js" th:src="@{/AdminStyle/js/fastclick.js}"></script>
<!-- AdminLTE App -->
<script src="../../dist/js/adminlte.min.js" th:src="@{/AdminStyle/js/adminlte.min.js}"></script>
<!-- AdminLTE for demo purposes -->
<script src="../../dist/js/demo.js" th:src="@{/AdminStyle/js/demo.js}"></script>
<script th:src="@{/AdminStyle/js/adminHead.js}"></script>
<script>
    $(function () {
        $('#example1').DataTable()
        $('#example2').DataTable({
            "oLanguage": {
                "sUrl": "/AdminStyle/page_zh_CN.json"
            },
            'paging': true,
            'lengthChange': true,
            'searching': true,
            'ordering': true,
            'info': true,
            'autoWidth': true
        })
    });

    $(document).ready(function () {
        $("#submit").click(function () {
            let name = $("#name").val();
            let str = $("#change").val(); //获取Select选择的Value
            let val = $("#val").val();
            $.post("/Admin/updateAdmin/data", {val: val, str: str, name: name}, function (data) {
                if (data == "yes") {
                    alert("修改成功！！");
                    window.location.reload();
                }
            });
        });
    });
</script>
</body>
</html>
